package com.wuxiaoqin.admin.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wuxiaoqin.admin.entity.Commodity;
import com.wuxiaoqin.admin.entity.goodParam.GoodsSales;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author jobob
 * @since 2021-11-02
 */
public interface CommoditySalesMapper extends BaseMapper<GoodsSales> {

    @Select(" select C_id,C_name,C_salesVolumes from commodity ORDER BY C_salesVolumes DESC limit  #{startIndex},#{pageSize} ")
    @Results({
            @Result( id = true ,property = "id", column = "C_id"),
            @Result(property="name" ,column="C_name"),
            @Result(property="salesvolumes", column="C_salesVolumes")
    }
    )
    public List<GoodsSales> selectForPage(Integer startIndex,Integer pageSize);

}
